package com.ljfresh.customer.controller;

import com.alibaba.fastjson.JSON;
import com.ljfresh.customer.erp.ERPBasicAPIUtil;
import com.ljfresh.customer.pojo.User;
import com.ljfresh.customer.result.Result;
import io.swagger.annotations.*;
import org.apache.http.HttpEntity;
import org.apache.http.ParseException;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author: Lucifer
 * @time: 2020/4/3-10:37
 */
@Api(value = "测试界面")
@RestController
public class TestController {

    @ApiOperation("测试接口")
    @RequestMapping(value = "/test",method = RequestMethod.GET)
    @ApiResponses({
            @ApiResponse(code = 200,message = "请求成功"),
            @ApiResponse(code = 400,message = "参数错误")
    })
    public Result test(@ApiParam(value = "aaa",name = "参数1",required = true) Integer aaa){

        try {
            Result userResult = new Result();
            //ERPBasicAPIUtil.getErpCode("http://54c8fk.natappfree.cc/user/redirectCode");


            return userResult;
        }catch (Exception e){
            return new Result(210101);
        }
    }

}
